package com.dzt.androidframework.network.mobapi.lottery;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.dzt.androidframework.adapter.AbsListAdapter;

import java.util.List;

/**
 * Created by M02323 on 2017/12/7.
 */

public class LotteryAdapter extends AbsListAdapter<String> {

	public LotteryAdapter(Context context, List<String> datas) {
		super(context, datas);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = layoutInflater.inflate(android.R.layout.simple_list_item_1, parent, false);
			holder.textView = (TextView) convertView.findViewById(android.R.id.text1);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		String name = datas.get(position);
		holder.textView.setText(name);
		return convertView;
	}

	private class ViewHolder {
		TextView textView;
	}
}
